package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
        import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IndexImageMapper;
import com.ruoyi.system.domain.IndexImage;
import com.ruoyi.system.service.IIndexImageService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ruoyi
 * @date 2024-03-04
 */
@Service
public class IndexImageServiceImpl extends ServiceImpl<IndexImageMapper, IndexImage> implements IIndexImageService
{
    @Autowired
    private IndexImageMapper indexImageMapper;

    @Override
    public List<IndexImage> indexList() {
        LambdaQueryWrapper<IndexImage> indexImageLambdaQueryWrapper=new LambdaQueryWrapper<>();
        indexImageLambdaQueryWrapper.orderByDesc(IndexImage::getSort);
        List<IndexImage> indexImageList = indexImageMapper.selectList(indexImageLambdaQueryWrapper);
        return indexImageList;
    }

    @Override
    public void addImage(IndexImage image) {
        image.setCreateTime(new Date());
        indexImageMapper.insert(image);
    }


}
